<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <rich:panel>
        <f:facet name="header">Statusprojeto Details</f:facet>


        <s:decorate id="nome" template="layout/display.xhtml">
            <ui:define name="label">Nome</ui:define>
            <h:outputText value="#{statusprojetoHome.instance.nome}"/>
        </s:decorate>

        <div style="clear:both"/>

    </rich:panel>

    <div class="actionButtons">

        <s:button view="/StatusprojetoEdit.xhtml"
                    id="edit"
                 value="Edit"/>

        <s:button view="/#{empty statusprojetoFrom ? 'StatusprojetoList' : statusprojetoFrom}.xhtml"
                    id="done"
                 value="Done"/>

    </div>

    <rich:tabPanel switchType="ajax">

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Projetos</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="projetosChildren">

        <h:outputText value="There are no projetos associated with this statusprojeto."
                   rendered="#{empty statusprojetoHome.projetos}"/>

        <rich:dataTable value="#{statusprojetoHome.projetos}"
                       var="_projeto"
                  rendered="#{not empty statusprojetoHome.projetos}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="projetosTable">
            <rich:column sortBy="#{_projeto.id}">
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_projeto.id}"/>
            </rich:column>
            <rich:column sortBy="#{_projeto.cliente}">
                <f:facet name="header">Cliente</f:facet>
                <h:outputText value="#{_projeto.cliente}"/>
            </rich:column>
            <rich:column sortBy="#{_projeto.custoprevisto}">
                <f:facet name="header">Custoprevisto</f:facet>
                <h:outputText value="#{_projeto.custoprevisto}"/>
            </rich:column>
            <rich:column sortBy="#{_projeto.datacriacao}">
                <f:facet name="header">Datacriacao</f:facet>
                <h:outputText value="#{_projeto.datacriacao}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </rich:column>
            <rich:column sortBy="#{_projeto.fim}">
                <f:facet name="header">Fim</f:facet>
                <h:outputText value="#{_projeto.fim}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </rich:column>
            <rich:column sortBy="#{_projeto.fimprevisto}">
                <f:facet name="header">Fimprevisto</f:facet>
                <h:outputText value="#{_projeto.fimprevisto}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </rich:column>
            <rich:column sortBy="#{_projeto.inicio}">
                <f:facet name="header">Inicio</f:facet>
                <h:outputText value="#{_projeto.inicio}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </rich:column>
            <rich:column sortBy="#{_projeto.justificativa}">
                <f:facet name="header">Justificativa</f:facet>
                <h:outputText value="#{_projeto.justificativa}"/>
            </rich:column>
            <rich:column sortBy="#{_projeto.necessidades}">
                <f:facet name="header">Necessidades</f:facet>
                <h:outputText value="#{_projeto.necessidades}"/>
            </rich:column>
            <rich:column sortBy="#{_projeto.nome}">
                <f:facet name="header">Nome</f:facet>
                <h:outputText value="#{_projeto.nome}"/>
            </rich:column>
            <rich:column sortBy="#{_projeto.orcamento}">
                <f:facet name="header">Orcamento</f:facet>
                <h:outputText value="#{_projeto.orcamento}"/>
            </rich:column>
            <rich:column sortBy="#{_projeto.premissas}">
                <f:facet name="header">Premissas</f:facet>
                <h:outputText value="#{_projeto.premissas}"/>
            </rich:column>
            <rich:column sortBy="#{_projeto.produto}">
                <f:facet name="header">Produto</f:facet>
                <h:outputText value="#{_projeto.produto}"/>
            </rich:column>
            <rich:column sortBy="#{_projeto.responsabilidadesgp}">
                <f:facet name="header">Responsabilidadesgp</f:facet>
                <h:outputText value="#{_projeto.responsabilidadesgp}"/>
            </rich:column>
            <rich:column sortBy="#{_projeto.restricoes}">
                <f:facet name="header">Restricoes</f:facet>
                <h:outputText value="#{_projeto.restricoes}"/>
            </rich:column>
            <rich:column sortBy="#{_projeto.resumo}">
                <f:facet name="header">Resumo</f:facet>
                <h:outputText value="#{_projeto.resumo}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectprojeto"
                     value="Select"
                      view="/Projeto.xhtml">
                    <f:param name="projetoId"
                            value="#{_projeto.id}"/>
                    <f:param name="projetoFrom" value="Statusprojeto"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add projeto"
                view="/ProjetoEdit.xhtml">
            <f:param name="statusprojetoId"
                    value="#{statusprojetoHome.instance.id}"/>
            <f:param name="projetoFrom" value="Statusprojeto"/>
        </s:button>
    </div>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
